home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / ip / nfs / amd / amd-5.2 / config / arch next >
Encoding:
Text File  |  1990-06-23  |  2.6 KB  |  97 lines

  1. #! /bin/sh
  2. #
  3. # $Id: arch,v 5.2 90/06/23 22:21:22 jsp Rel $
  4. #
  5. # Copyright (c) 1989 Jan-Simon Pendry
  6. # Copyright (c) 1989 Imperial College of Science, Technology & Medicine
  7. # Copyright (c) 1989 The Regents of the University of California.
  8. # All rights reserved.
  9. #
  10. # This code is derived from software contributed to Berkeley by
  11. # Jan-Simon Pendry at Imperial College, London.
  12. #
  13. # Redistribution and use in source and binary forms are permitted provided
  14. # that: (1) source distributions retain this entire copyright notice and
  15. # comment, and (2) distributions including binaries display the following
  16. # acknowledgement:  ``This product includes software developed by the
  17. # University of California, Berkeley and its contributors'' in the
  18. # documentation or other materials provided with the distribution and in
  19. # all advertising materials mentioning features or use of this software.
  20. # Neither the name of the University nor the names of its contributors may
  21. # be used to endorse or promote products derived from this software without
  22. # specific prior written permission.
  23. # THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
  24. # WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
  25. # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  26. #
  27. #    %W% (Berkeley) %G%
  28. #
  29. # Figure out machine architecture
  30. #
  31.  
  32. PATH=/bin:/usr/bin:/usr/ucb:/etc:/usr/local/bin:${PATH} export PATH
  33.  
  34. #
  35. # First try to find a standard command
  36. #
  37. a=arch        # Sun compat
  38. m=machine    # BSD compat
  39. u=uname        # Sys5 compat
  40.  
  41. if [ -f /etc/$a -o -f /bin/$a -o -f /usr/bin/$a -o -f /usr/local/bin/$a ]
  42. then
  43.     exec $a
  44. elif [ -f /etc/$m -o -f /bin/$m -o -f /usr/bin/$m -o -f /usr/ucb/$m -o -f /usr/local/bin/$m ]
  45. then
  46.     exec $m
  47. elif [ -f /etc/$u -o -f /bin/$u -o -f /usr/bin/$u -o -f /usr/local/bin/$u ]
  48. then
  49.     ARCH="`uname`"
  50.     case "$ARCH" in
  51.         "HP-UX") echo hp9000; exit 0;;
  52.         AIX*) MACH="`uname -m`"
  53.             case "$MACH" in
  54.             00*) echo ibm6000; exit 0;;
  55.             10*) echo ibm032; exit 0;;
  56.             20*) echo ibm032; exit 0;;
  57.             esac
  58.             ;;
  59.         A/UX) echo macII ; exit 0 ;;
  60.         *) ;;
  61.     esac
  62. fi
  63.  
  64. #
  65. # Take a pot-shot at your machine architecture
  66. #
  67. echo "    ... No ARCH= option specified; dynamically determining architecture" >&2
  68.  
  69. case "`exec 2>/dev/null; head -2 /etc/motd`" in
  70. *"HP-UX"*)        ARCH=hp9000;;
  71. *"Ultrix"*)        ARCH=vax;;
  72. *"RISC iX"*)        ARCH=arm;;
  73. *"Umax 4.2"*)        ARCH=encore;;
  74. *"Alliant Concentrix"*)    ARCH=alliant;;
  75. *"FPS Model 500"*)    ARCH=fps500;;
  76. *)            ARCH=unknown;
  77.             if [ -d /usr/include/caif ]; then
  78.                 ARCH=ibm032
  79.             elif [ -f /bin/pyr ]; then
  80.                 if /bin/pyr; then
  81.                     echo pyr; exit 0
  82.                 fi
  83.             fi
  84.             ;;
  85. fi
  86.  
  87. esac
  88.  
  89. echo "    ... architecture appears to be \"${ARCH}\"" >&2
  90. echo $ARCH
  91.  
  92. case "$ARCH" in
  93. unknown) exit 1
  94. esac
  95.  
  96. exit 0
  97.